package com.tidc.seaserverweb.controller;

import com.tidc.seaservermodel.entity.Fres;
import com.tidc.seaservermodel.exception.TidcBadParent;
import com.tidc.seaserverservice.service.SecondaryCommitmentService;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;


@RestController
@RequestMapping("/secondary/commitment")
public class SecondaryCommitmentController {
    @Resource
    private SecondaryCommitmentService secondaryCommitmentService;
    @GetMapping("/list")
    public Fres<Map<Object,Object>> commitmentList(@RequestParam("type") int type,@RequestParam("pageSize") int pageSize, @RequestParam("pageNum") int pageNum, Authentication authentication) throws TidcBadParent {
        return secondaryCommitmentService.commitmentList(type,pageSize,pageNum,authentication);
    }

}
